import { useUserStore } from "@/stores/user";
import { request } from "@/utils/request";

const userStore = useUserStore();

// 首页产品
export const apiProductPage = (data: any = {}) => {
  // const appUserId = userStore.userInfo.id;
  return request({
    url: '/commodity/pageList',
    method: 'POST',
    data
    // data: {...data, appUserId}
  });
}
// 产品详情
export const apiProductDetails = (data: any) => {
  return request({
    url: '/commodity/details',
    method: 'POST',
    data
  });
}

export const apiProductDetails1 = (data: any) => {
  return request({
    url: '/commodity/detailsInfo',
    method: 'POST',
    data
  });
}

// 商品管理-修改
export const apiProductEdit = (data: any) => {
  return request({
    url: '/commodity/edit',
    method: 'POST',
    data
  });
}

// 商品管理-删除
export const apiProductRemove = (data: any) => {
  return request({
    url: '/commodity/remove',
    method: 'POST',
    data
  });
}

// 商品管理-认证
export const apiProductAuth = (data: any) => {
  return request({
    url: '/certification/add',
    method: 'POST',
    data
  });
}
// 商品管理-字典值
export const apiProductDict = (data: any) => {
  return request({
    url: '/types/stoneList',
    method: 'POST',
    data
  });
}

// 商品管理-认证费用
export const apiProductAuthCost = (data: any) => {
  return request({
    url: '/user/getCommissionSetting',
    method: 'POST',
    data
  });
}

// 奇石分类类型-查询 http://localhost:8080/leshi/types/info
export const typesInfo = (data: any) => {
  return request({
    url: '/types/info',
    method: 'POST',
    data
  });
}


export const searchHistoryList = (data: any) => {
  return request({
    url: '/SearchHistory/list',
    method: 'POST',
    data
  });
}

export const searchHistoryRemove = (data: any) => {
  return request({
    url: '/SearchHistory/remove',
    method: 'POST',
    data
  });
}

// 查询-商铺信息 http://localhost:8080/leshi/shop/shopInfoPage
export const getShopInfoPage = (data: any) => {
  return request({
    url: '/shop/shopInfoPage',
    method: 'POST',
    data
  });
}

// 珍宝档案
export const apiSelltList = (data: any) => {
  return request({
    url: '/user/selltList',
    method: 'POST',
    data
  });
}
// 推荐榜
export const apiShopList = (data: any) => {
  return request({
    url: '/user/shopList',
    method: 'POST',
    data
  });
}
// 推荐 取消推荐
export const apiUpTj = (data: any) => {
  return request({
    url: '/commodity/upTj',
    method: 'POST',
    data
  });
}
